<?php
/**
 * Created on 18 mars 08 by Eric Jeker <eric.jeker@gmail.com>
 * Created on Eclipse 3.2 with PHPEclipse 1.1.8
 * (c) 2007 - 2008 Copyright Eric Jeker <eric.jeker@gmail.com>
**/
?>

<table cellpadding="2" cellspacing="0" border="0">
	<tr>
		<th>#</th>
		<th>player</th>
		<th>points</th>
		<th>victory</th>
		<th>defeat</th>
		<th>draw</th>
		<th>total</th>
		<th>ratio</th>
	</tr>
<?php foreach($ranking as $player)	{ ?>
	<tr onmouseover="this.className = 'over';" onmouseout="this.className = '';">
		<th><?php echo $player->getRank() ?></th>
		<td><?php echo link_to($player->getsfGuardUser()->getUsername(), 'player/details?player='.$player->getUserId()) ?></td>
		<td class="center"><?php echo $player->getPoints() ?></td>
		<td class="center"><?php echo $player->getNbWin() ?></td>
		<td class="center"><?php echo $player->getNbLoss() ?></td>
		<td class="center"><?php echo $player->getNbDraw() ?></td>
		<td class="center"><?php echo $player->getNbChallenge() ?></td>
		<td class="center"><?php echo $player->getNbChallenge() > 0 ? round((($player->getNbWin() + $player->getNbDraw() * 0.5) / $player->getNbChallenge()) * 100) . "%" : 'n/a' ?></td>
	</tr>
<? } ?>
</table>